/*    */ package com.wzh.action.front.book;
/*    */ 
/*    */ import com.opensymphony.xwork2.ActionContext;
/*    */ import com.wzh.action.front.CommonAction;
/*    */ import com.wzh.bean.QueryResult;
/*    */ import com.wzh.service.bookinfo.BookInfoService;
/*    */ import com.wzh.utils.WebTool;
/*    */ import java.util.List;
/*    */ import javax.annotation.Resource;
/*    */ import org.apache.struts2.ServletActionContext;
/*    */ import org.springframework.stereotype.Controller;
/*    */ 
/*    */ @Controller
/*    */ public class SearchAction extends CommonAction
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/*    */ 
/*    */   @Resource
/*    */   private BookInfoService bookService;
/*    */   private String wd;
/* 24 */   private int page = 1;
/*    */ 
/*    */   public int getPage()
/*    */   {
/* 28 */     return this.page;
/*    */   }
/*    */ 
/*    */   public void setPage(int page)
/*    */   {
/* 34 */     this.page = page;
/*    */   }
/*    */ 
/*    */   public String getWd()
/*    */   {
/* 40 */     return this.wd;
/*    */   }
/*    */ 
/*    */   public void setWd(String wd)
/*    */   {
/* 46 */     this.wd = wd;
/*    */   }
/*    */ 
/*    */   public String search()
/*    */   {
/* 52 */     if ((this.wd != null) && (!"".equals(this.wd))) {
/* 53 */       List searchlist = 
/* 54 */         this.bookService.getScrollData(0, 10, " o.author=?1 or o.title=?2", new String[] { this.wd, this.wd }).getResultlist();
/* 55 */       this.bookService.setInfo(searchlist, false, true);
/* 56 */       ActionContext.getContext().put("searchlist", searchlist);
/*    */     }
/*    */ 
/* 59 */     if (WebTool.isMHost(ServletActionContext.getRequest()))
/*    */     {
/* 61 */       this.template += "/mobile";
/*    */     }
/* 63 */     return "search";
/*    */   }
/*    */ }

/* Location:           C:\work\apache-tomcat-7.0.55\webapps\ROOT\WEB-INF\classes\
 * Qualified Name:     com.wzh.action.front.book.SearchAction
 * JD-Core Version:    0.6.1
 */